home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7861 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: anvil.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: C/C++ Unix port advise
  5. Date: 27 Feb 1996 15:48:35 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4h058jINNg4k@anvil.ugrad.cs.ubc.ca>
  8. References: <4gvri8$q94@symiserver2.symantec.com>
  9. NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
  10.  
  11. In article <4gvri8$q94@symiserver2.symantec.com>,
  12. kirsten konopaski <kkonopa@symantec.com> wrote:
  13.  >Hi anyone,
  14.  >
  15.  >My experience is in C/C++ for both Windows 3.x/4.x and DOS targets.  I am now
  16.  >tasked with writing a 32bit application that will link to a third party DLL to
  17.                        ^^^^^^^^^^^^^^^^^
  18.  
  19. You can't have any other! There is no need for such terminology in the UNIX
  20. world. :))
  21.  
  22.  >run on HP Unix.  
  23.  
  24.  >I only have the typical development tools for PCs (ie: Symantec C++ and
  25.  >Microsoft C++ dev tools).  I would like to do my development here, and then port
  26.  >to unix.
  27.  >
  28.  >Any recommendations on where to start and what compiler/linker settings are
  29.  >necessary so that I don't shoot myself in the foot?  ie: (paragraph alignment,
  30.  >data types, etc.).
  31.  
  32. You don't worry about ``paragraph alignment''---there is no such thing;
  33. paragraphs are an 8086 idiom. The HP-UX process memory model is not segmented,
  34. hence no paragraphs.  (Actually the HPPA processor does support segmentation,
  35. but it's a whole different thing that you don't have to be concerned about).
  36.  
  37. The alignment is for the most part directed by the requirements of the 
  38. processor. For example, all integers (which are 32-bit) are stored at addresses
  39. that are divisible by four. Trying to store an integer at a different address
  40. will result in a fault.
  41.  
  42. I've never had to give a UNIX compiler directives to influence things like
  43. structure packing, though it's possible.
  44.  
  45. You don't have to worry about different kinds of memory models. There is only
  46. one, really. HP-UX gives your process a 4GB virtual address space. The first
  47. ``quadrant'' (1GB) is for your code. The second for data/stack. The third is
  48. where shared libraries go. And the fourth is for the kernel. You are not ever
  49. likely to run out of stack or heap space; as you allocate more storage, the OS
  50. just ``automagically'' adds more pages to your address space.
  51.  
  52.  >Where can I get info on HP unix compilers: cc or gcc?  Is there a good third
  53.  >party book on the basics?  And where can I get the HP UNIX compiler/linker for C
  54.  
  55. The HP-UX cc man page explains all of the options of their compiler, and
  56. the ld man page describes the linker. You are bound to have some printed
  57. documentation as well. The HP web site also has all kinds of documents; for
  58. example, you can download a big document about the HPPA-RISC instruction set
  59. and programming in assembly language.  Where you can get the compiler and
  60. linker is from a Hewlett-Packard representative. GCC is freely available, but
  61. unless you get binaries, you need HP's compiler to compile GCC.
  62. -- 
  63.  
  64.